package main

// 24
func swapPairs(head *ListNode) *ListNode {

	newList := &ListNode{Next: head}
	cur := newList
	for cur.Next != nil && cur.Next.Next != nil {

		node1 := cur.Next
		node2 := node1.Next
		next := node2.Next

		node1.Next = next
		node2.Next = node1
		cur.Next = node2
		cur = node1
	}
	return newList.Next
}
